import { connectService } from "@/utils/serviceTool/service";

export default async function (params) {
  if (!Object.hasOwn(this.form, "id")) {
    this.form.id = null;
  }
  const payload = {
    data: this.form,
  };
  if (this.form && this.form.id) {
    payload.templateName = params ? params.update : "";
  } else {
    payload.templateName = params ? params.save : "";
  }
  const res = await connectService(payload);
  return res;
}
